﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WMSSyncData.DAL;
using WMSSyncData.DAL.MESTOWMS;
using WMSSyncData.Model.WMSModel;

namespace WMSSyncData.Core.MESTOWMSCore
{
    public class InStockCore
    {
        public void InsertInStock()
        {
            //插入入库表
            List<WMS_T_InStock> inStockList = new InStockDAL().GetInStock();
            new BaseSqlDBDAL<WMS_T_InStock>().InsertBatch(inStockList);
            //插入入库行表（成品）
            List<WMS_T_InStockRows> InStockRowsFinishList = new InStockRows_FinishDAL().GetInStockRows();
            new BaseSqlDBDAL<WMS_T_InStockRows>().InsertBatch(InStockRowsFinishList);
            //插入入库行表（半成品）
            List<WMS_T_InStockRows> InStockRowsSemiFinishList = new InStockRows_SemiFinishDAL().GetInStockRows();
            new BaseSqlDBDAL<WMS_T_InStockRows>().InsertBatch(InStockRowsSemiFinishList);
            //修改中间数据状态   
            if (inStockList.Count>0)
            {
                new InStockDAL().UpdateDataStatus(inStockList);
            }
        }
    }
}
